package com.leonzhangxf.aop.introduction;

import com.leonzhangxf.aop.introduction.service.SomeService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * The demo of use {@link AnnotationConfigApplicationContext}
 * to perform spring IOC.
 *
 * @author leonzhangxf
 */
@Configuration
@ComponentScan({"com.leonzhangxf.aop.introduction", "com.leonzhangxf.aop.primary"})
public class ApplicationContextForIntroductionStarter {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext =
            new AnnotationConfigApplicationContext(ApplicationContextForIntroductionStarter.class);

        SomeService someService = applicationContext.getBean(SomeService.class);
        someService.doSomeThing();
    }
}
